package com.yuexiang.melodyhub.authserver.feign;

import com.yuexiang.melodyhub.common.dto.user.UserAdd.param.UserAddParam;
import com.yuexiang.melodyhub.common.dto.user.UserFindByEmail.param.UserFindByEmailParam;
import com.yuexiang.melodyhub.common.dto.user.UserFindByEmail.response.UserFindByEmailResponse;
import com.yuexiang.melodyhub.common.dto.user.UserFindWithRolesByUsername.param.UserFindWithRolesByUsernameParam;
import com.yuexiang.melodyhub.common.dto.user.UserFindWithRolesByUsername.response.UserFindWithRolesByUsernameResponse;
import com.yuexiang.melodyhub.common.result.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("MelodyHub-User")
public interface UserFeignService {

    @PostMapping("/user/add")
    ResultData<?> add(@RequestBody UserAddParam userParam);

    @PostMapping("/user/findWithRolesByUsername")
    public ResultData<UserFindWithRolesByUsernameResponse> findWithRolesByUsername(UserFindWithRolesByUsernameParam userFindParam);

    @PostMapping("/user/findByEmail")
    public ResultData<UserFindByEmailResponse> findByEmail(@RequestBody UserFindByEmailParam userFindByEmailParam);

    @PostMapping("/user/saveLastTimeByEmail")
    public ResultData<?> saveLastTimeByEmail(@RequestParam("email") String email);
}
